<template>
  <div class="main">
    <govheader
      title="化工产业大脑 · 产业链图谱"
      @zfNameflagChange="zfNameflagChange"
    ></govheader>
    <govnavigation></govnavigation>
    <iframe v-if="zfNameflag" src="https://industry-chain.quant-chi.com:8104/chemistry/industryChain" frameborder="0" width="100%" height="1080px"></iframe>
  </div>
</template>
<script>
import dd from 'gdt-jsapi';
import govheader from '@/components/govheader'
import govnavigation from '@/components/govnavigation2'
export default {
  name: 'zfIndustrialChainMap',
  components: { govheader, govnavigation },
  data () {
    return {
      zfNameflag: true
    }
  },
  created() {
    if (window.SITE_CONFIG["sitURL"] === "https://www.plantmate.com/api") {
      dd.getAuthCode({})
        .then((res) => {
          if (res) {
            let params = {
              applicationFlag: "20",
              authCode: res.auth_code,
            };
            this.$http
              .post(`/home/sys/loginfree/authentication`, params)
              .then(({ data: res }) => {
                console.log("res2:", res);
                this.$store.commit("zfName", res.data.lastName);
                if (res.code !== 0) {
                  this.zfNameflag = false;
                }
              })
              .catch(() => {
                this.zfNameflag = false;
              });
          }
        })
        .catch(() => {
          this.zfNameflag = false;
        });
    }
  },
  // 调用
  mounted () {
    
  },
  methods: {
    zfNameflagChange(val) {
      this.zfNameflag = val;
    },
  }
}
</script>
<style lang="scss" scoped>
.top {
  width: 100%;
  height: 80px;
  line-height: 60px;
  box-sizing: border-box;
  color: rgb(115, 188, 235);
  background-image: url("../../../assets/img/zf/top_bg1.png");
  background-size: 100% 100%;
  position: fixed;
}
</style>
